//
//  DGPUploadRequest.swift
//  DragonPlatform
//
//  Created by JF.Zhan on 2017/10/16.
//  Copyright © 2017年 JF.Zhan. All rights reserved.
//

import UIKit

class DGPUploadRequest: DGPBaseRequest {

    //上传头像
    func upload_mylogoRequest(onlineSign:String,image:UIImage) {
    
        dataImage = image
        
        parameters["onlineSign"] = onlineSign
        
        url = baseRequestUrlOfPersonalCenter+"app/user/editYhtx"
        
        needLoading = false
    }
    
    //上传证件
    func upload_credentialsRequest(orgid:String,image:UIImage,fileName:String,onlineSign:String,fileType : String) {
        
         dataImage = image
        
//        parameters["orgid"] = orgid
//
//        parameters["fileName"] = fileName
        
        parameters["onlineSign"] = onlineSign
        
        parameters["id"] = orgid
        
        parameters["fileType"] = fileType
        
        parameters["file"] = fileName
        
        url = baseRequestUrl + "dt/admin/commonUploadImg"
        
        needLoading = true
    }
    
    //上传商品图片
    func upload_goodsPhoto(id:String,tpType:String,onlineSign:String,image:UIImage) {
    
        dataImage = image
        
        parameters["id"] = id
        
        parameters["tpType"] = tpType
        
        parameters["onlineSign"] = onlineSign
        
        url = baseRequestUrl + "app/sp/uploadSpImg"
        
        needLoading = true
        
    }
    
    //上传证件
    func upload_credentialsRequest(orgid:String,image:UIImage,fileName:String) {
        
        dataImage = image
        
        parameters["orgid"] = orgid
        
        parameters["fileName"] = fileName
        
        url = baseRequestUrlOfPersonalCenter+"appFileCtl/fileUpload"
        
        needLoading = true
    }
    
    //上传店铺图片
    func upload_shopPhoto(orgid:String,image:UIImage,fileName:String) {
        
        dataImage = image
        
        parameters["orgid"] = orgid
        
        parameters["fileName"] = fileName
        
        url = baseRequestUrl+"appFileCtl/fileUploadLogo"
        
        needLoading = true
        
    }
     //售后服务上传图片接口
     func upload_shouHouPhone(orgid:String,image:UIImage,type:String,onlineSign:String,fileName:String){
          dataImage = image
          
          parameters["orgid"] = orgid
          
          parameters["type"] = type
          
          parameters["onlineSign"] = onlineSign
          
          parameters["fileName"] = fileName
          
          url = baseRequestUrl+"appFileCtl/fileUpShfw"
          
          needLoading = true
     }
    
}
